<?php
/**
 * Created by PhpStorm.
 * User: s.utkin
 * Date: 20.05.2015
 * Time: 17:40
 */

namespace SitemapGenerator\DataProvider;


use Traversable;

class ListProvider implements \IteratorAggregate {

	protected $items = [];

	public function __construct($params)
	{
		$this->items = (array)isset($params['items']) ? $params['items'] : [];
	}

	/**
	 * (PHP 5 &gt;= 5.0.0)<br/>
	 * Retrieve an external iterator
	 * @link http://php.net/manual/en/iteratoraggregate.getiterator.php
	 * @return Traversable An instance of an object implementing <b>Iterator</b> or
	 * <b>Traversable</b>
	 */
	public function getIterator()
	{
		return new \ArrayIterator($this->items);
	}
}